"""
# -*- coding: utf-8 -*-
# @Time    : 2023/5/21 22:35
# @Author  : 王摇摆
# @FileName: ModelImpl.py
# @Software: PyCharm
# @Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
"""
import numpy as np
from SVM.SVM3.Manual.Model import SMO
from SVM.SVM3.Manual.Data import X, y


# 线性核函数支持向量机
def linearKernel(x, z, degree=3, coef0=0.0, gamma=1.0):
    return x.dot(z)

# 多项式核函数支持向量机
def polynomialKernel(x, z, degree=3, coef0=0.0, gamma=1.0):
    return np.power(gamma * x.dot(z) + coef0, degree)

# 径向基核函数支持向量机
def rbfKernel(x, z, degree=3, coef0=0.0, gamma=1.0):
    return np.exp(-gamma * np.power(np.linalg.norm(x - z), 2))
